
<script type="text/javascript">
	jQuery(function($) { 
		$("ul.jt-tabs").tabs("div.jt-panes > div");
		
		$("#kind").change(function() {
			$("p.options").hide();
			$("p.option" + $(this).val()).show();
		}).change();
	});
</script>

<form action="" method="post" enctype="multipart/form-data">

<? if (sizeof($DIAGS)) { ?>
	<div class="diags"><p><?=implode("</p><p>", $DIAGS)?></p></div>
<? } ?>


	<ul class="jt-tabs"><?

		foreach($DATA['langs'] as $lang) {
			?><li><a href="#<?=$lang['text']?>"><?=$lang['assoc']?></a></li><? 
		} 
		
	?></ul>
	
	<div class="jt-panes">
	
		<? $t = true; 
			foreach($DATA['langs'] as $lang) { $l = $lang['text'];
	
			?><div class="jt-pane" style="<?=$t ? "display:block" : ""?>">
		
					<p><strong>Field name</strong><br />
						<input type="text" class="wide" name="title[<?=$l?>]" value="<?=dat('object', 'data', $l, 'title')?>" />
					</p>
		
					<p class="options option3" style="display:none"><label>Options list (one option per line)<br />
						<textarea class="wide no-editor" name="params[<?=$l?>]" rows="10"><?=dat('object', 'data', $l, 'params')?></textarea>
					</label></p>
			</div><? 
		
		$t = false; } ?>
	
	</div>



<div>
	<h3>Field settings</h3>

	<p><label>Field type<br />
		<select name="kind" id="kind">
			<option value="1" <?=(1 == dat('object','kind')) ? " selected" : ""?>>Single line text field</option>
			<option value="2" <?=(2 == dat('object','kind')) ? " selected" : ""?>>Multiple line text field</option>
			<option value="3" <?=(3 == dat('object','kind')) ? " selected" : ""?>>Dropdown options list</option>
			<option value="4" <?=(4 == dat('object','kind')) ? " selected" : ""?>>File upload</option>
		</select>
	</label></p>

	<p class="options option4" style="display:none"><label>Comma separated list of allowed file extensions<br />
		<input type="text" class="wide" name="value" value="<?=dat('object', 'value')?>" />
	</label></p>

	<p><label><input type="checkbox" name="required" value="1" <?=dat('object','required') ? 'checked="checked"' : ''?> /> Required</label></p>

	<p><input type="submit" name="editor_save" value="Save" /></p>

</div>


</form>
